public enum Demo1 {
    ChuLian("小茹不甜",20),NPY("猪猪小野",22),
    QianRen("陈妮妮",25);
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    Demo1(String name,int age) {
        this.name = name;
        this.age = age;
    }
}
class Teest{
    public static void main(String[] args) {
        Demo1 cl = Demo1.ChuLian;
        System.out.println(cl.ordinal());
        Demo1 npy= Demo1.NPY;
        System.out.println(npy.ordinal());
        Demo1[] values = Demo1.values();
        for (int i = 0; i < values.length ; i++) {
            Demo1 qr = values[i];
            System.out.println(qr.getName());
            System.out.println(qr.getAge());
        }
        Demo1 zcj = Demo1.valueOf("蛋挞小屁孩");
        System.out.println(zcj.getName());
    }

}